﻿using System;

namespace SharePointUtilitiesForDevelopers.Mapper
{
    /// <summary>
    /// The exception that is thrown when an object cannot be mapped.
    /// </summary>
    /// <typeparam name="TFrom">The type mapping from when the exception occurred.</typeparam>
    /// <typeparam name="TTo">The type mapping to when the exception occurred.</typeparam>
    public class SharePointMapperException<TFrom, TTo>: Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SharePointMapperException{TFrom,TTo}"/> class.
        /// </summary>
        /// <param name="innerException">The inner exception.</param>
        public SharePointMapperException(Exception innerException)
            : base(string.Format(Properties.Resources.MapperException, typeof(TFrom).FullName, typeof(TTo).FullName), innerException)
        {
        }
    }
}